package com.fenghongzhang.day009;

import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
import com.bigkoo.pickerview.listener.OnOptionsSelectListener;
import com.bigkoo.pickerview.view.OptionsPickerView;

import java.util.ArrayList;
import java.util.List;

public class Main3Activity extends AppCompatActivity {
//    private WheelView wheelV;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);

//
//        wheelV = (WheelView) findViewById(R.id.wheelV);
//
//        wheelV.setOnItemSelectedListener(new OnItemSelectedListener() {
//            @Override
//            public void onItemSelected(int index) {
//                Log.i("Simon", "onItemSelected index: " + index);
//            }
//        });
//        List<String> list = new ArrayList<>();
//        list.add("我的中国心");
//        list.add("北国之春");
//        list.add("鹿港小镇");
//        ArrayWheelAdapter arrayWheelAdapter = new ArrayWheelAdapter(list);
//        wheelV.setAdapter(arrayWheelAdapter);



//        final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//
//        TimePickerView build = new TimePickerBuilder(this, new OnTimeSelectListener() {
//            @Override
//            public void onTimeSelect(Date date, View v) {
//                String format = simpleDateFormat.format(date);
//                Toast.makeText(Main3Activity.this, format, Toast.LENGTH_SHORT).show();
//            }
//        }).build();
//        build.show();

        OptionsPickerView<String> build = new OptionsPickerBuilder(this, new OnOptionsSelectListener() {
            @Override
            public void onOptionsSelect(int options1, int options2, int options3, View v) {

            }
        }).build();

        List<String> options1Items = new ArrayList<>();
        options1Items.add("射雕英雄传");
        options1Items.add("神雕侠侣");
        options1Items.add("鹿鼎记");

        List<String> options2Items_01 = new ArrayList<>();
        options2Items_01.add("郭靖");
        options2Items_01.add("黄蓉");
        options2Items_01.add("杨铁心");
        options2Items_01.add("欧阳克");
        List<List<String>> options2Items = new ArrayList<>();
        List<String> options2Items_02 = new ArrayList<>();
        options2Items_02.add("小龙女");
        options2Items_02.add("杨过");
        options2Items_02.add("大雕");
        options2Items.add(options2Items_01);
        options2Items.add(options2Items_02);

        build.setPicker(options1Items,options2Items);
        build.show();
    }
}
